﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="ZLDC.Estate.swfupload.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>图片上传</title>
		 <base target="_self" />

		<link href="css/style.css" rel="stylesheet" type="text/css" />
			<script type="text/javascript" src="js/swfupload.js"></script>
			<script type="text/javascript" src="js/handlers.js"></script>
		<script type="text/javascript">
		    var upload1;
		    var baseurl = "http://" + window.location.host + "/swfupload/";
		window.onload = function() {		
			upload1 = new SWFUpload({
				// Backend Settings
			upload_url: "../upload.aspx",
				//post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},

				// File Upload Settings
				file_size_limit : "10240",	// 100MB
				file_types : "*.jpg",
				file_types_description: "JPG Images",
				file_upload_limit: "<%=photocount %>",
				file_queue_limit : "0",

				// Event Handler Settings (all my handlers are in the Handler.js file)
				file_dialog_start_handler : fileDialogStart,
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,

				// Button Settings
				button_image_url: "../images/XPButtonUploadText_92x22.png",
				button_placeholder_id : "browse_link",
				button_width: 92,
				button_height: 23,
				
				// Flash Settings
				flash_url : "js/swfupload.swf",
				

				custom_settings : {
					progressTarget : "fileList",
					cancelButtonId : "clear_all"
				},
				
				// Debug Settings
				debug: false
			});

			
			//fix flash refresh;
			//swfu.loadFlash();
		}
		
		var returnFiles=new Array();
		
	  function startUpload()
	  { 
	 	upload1.startUpload(); 
	 	return false;
	  }

	  function closeWindow() {
	      //window.location.href = "SavePhoto.aspx";
			//window.returnValue = returnFiles;
			//window.close();
		}
		
		//当点击清楚以下文件按钮时，清空返回字符串
		function cancelReturnValue(){
			returnFiles=new Array();
		}
</script>
	</head>

	<body>
		<form id="form1" runat="server">
		<div class="all">
			<div class="but_01">
				<a id="browse_link" href="#"><img width="89" height="23" src="images/select.gif"
						alt="选择文件" vspace="2" border="0" />
				</a>&nbsp;
				<a id="clear_all" href="#" onclick="cancelReturnValue();cancelQueue(upload1)" disabled="true"><img
						src="images/del.gif"
						alt=清除以下文件 " width="141" height="23" vspace="2" border="0" />
				</a>
			</div>
			<div class="note">
				注意事项：本次上传不超过<%=photocount %>个图片，每个文件不超过 10 M
			</div>
			<div id="bg_02">
				<div class="file">
					<span class="font_red" id="fileCount">0</span> 个上传图片，共
					<span class="font_red" id="fileTotleSize">0B</span>
				</div>
				<div class="table">
					<table width="100%" border="0" cellpadding="5" cellspacing="1"
						bgcolor="#CCCCCC">
						<tr>
							
							<td width="150" bgcolor="#EAEAEA">
								<strong>文件大小</strong>
							</td>
							<td width="47" bgcolor="#EAEAEA">
								<strong>清除</strong>
							</td>
						</tr>
					</table>
					<div id="box"
						style="overflow:scroll; height:180px; width:100%; font-size: 12px; color: #999999; font-style: normal;">
						<table id="fileList" cellpadding="5" cellspacing="1">
						<!-- 这里是用来显示列表，在my_callbacks中触发fileQueuedByCustomize方法(id='fileList') -->							
						</table>
					
					</div>
				</div>
			</div>
			<div class="but_02">				
					<a id="upload_link" href="javascript:void(0);" onclick="javascript:startUpload();"><img src="images/upload.gif"
							alt="上传文件" width="89" height="23" vspace="2" border="0" /></a>
                <asp:ImageButton ID="btnNext" runat="server" 
                        ImageUrl="~/swfupload/images/next.gif" onclick="btnNext_Click" />
			</div>
			 <div id="spanButtonPlaceholder"></div>
		</div>
	    </form>
	</body>
</html>
